﻿#include <QCoreApplication>

#include "codeversion.h"
#include "memento.h"
#include "codemanager.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    CodeManager* codeManager = new CodeManager();

    CodeVersion* codeVersion = new CodeVersion();

    codeVersion->setVersion(1, "2020-08-28", "first");
    codeManager->commit(codeVersion->save());

    codeVersion->setVersion(2, "2020-08-29", "second");
    codeManager->commit(codeVersion->save());

    codeVersion->setVersion(3, "2020-08-30", "third");
    codeManager->commit(codeVersion->save());

    codeManager->codeLog();
    codeVersion->restore(codeManager->checkout(2));

    codeVersion->current();
    codeManager->codeLog();

    return a.exec();
}
